<template>
  <div class="EmergencyList">
    <div class="flex location-wrap">
      <span class="white">当前位置：</span>
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/EDManagement' }">应急处置</el-breadcrumb-item>
        <el-breadcrumb-item>响应研判</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="box">
      <!-- 列表筛选 -->
      <filterTitle @query="query" @reset="reset">
        <el-form slot="filter" class="form" ref="form" :model="form" inline size="small" label-width="130px">
          <el-form-item :label="item.label + '：'" v-for="(item, index) in formData" :key="index" :prop="item.id">
            <LsdForm :compData="item" :form="form" />
          </el-form-item>
        </el-form>
      </filterTitle>
      <!-- 列表表格 -->
      <LsdTable slot="gjxm" @select="handleSelectionChange" :paginationAtrrs="paginationAtrrs"
        @pageChange="handleSizeChange" :compRef="table.compRef" ref="gjxm" :columns="table.columns" :title="table.title"
        :actions="table.actions" :tableData="table.tableData" :tableAttr="table.tableAttr" :isShowPage="table.isShowPage"
        :isSelectFlag="table.isSelectFlag" :isSequenceFlag="table.isSequenceFlag" @onActionClick="onActionClick" />
    </div>
    <!-- 弹窗信息 -->
    <LsdDialog :dialogConfig="dialogConfig" @handleBtn="handleBtn" @close="close">
      <LsdDialogTitle slot="dialog" :titleConfig="titleConfig" :activeNames="activeNames">
        <DialogForm ref="formComponent" slot="slot1" :formConfig="formConfig" />
        <!-- 灾情信息 -->
        <LsdTable slot="slot2" :compRef="tableInformation.compRef" :columns="tableInformation.columns"
          :actions="table.actions" :tableData="tableInformation.tableData" :tableAttr="tableInformation.tableAttr"
          :isShowPage="tableInformation.isShowPage" :isSelectFlag="tableInformation.isSelectFlag"
          :isSequenceFlag="tableInformation.isSequenceFlag" />
        <LsdTable slot="slot3" :compRef="tables.compRef" ref="gjxm" :columns="tables.columns" :title="tables.title"
          :actions="tables.actions" :tableData="tables.tableData" :tableAttr="tables.tableAttr"
          :isShowPage="tables.isShowPage" :isSelectFlag="tables.isSelectFlag" :isSequenceFlag="tables.isSequenceFlag" />
        <DialogForm ref="formComponent1" slot="slot4" :formConfig="formConfig1" />
        <DialogForm ref="formComponent2" slot="slot5" :formConfig="formConfig2" />
        <DialogForm ref="formComponent3" slot="slot6" :formConfig="formConfig3" />
      </LsdDialogTitle>
    </LsdDialog>
    <!-- 弹窗信息研判结果 -->
    <LsdDialog :dialogConfig="dialogConfig1" @handleBtn="handleBtn1">
      <LsdDialogTitle slot="dialog" :titleConfig="titleConfig1" :activeNames="activeNames1">
        <DialogForm ref="formComponent4" slot="slot1" :formConfig="formConfig4" />
        <DialogForm ref="formComponent5" slot="slot2" :formConfig="formConfig5" />
      </LsdDialogTitle>
    </LsdDialog>
  </div>
</template>

<script>
import {
  EmergencyEventgetSubmit
} from "@/api/EmergencyDisposal/yjsj.js";
// 响应研判 api
import {
  listPage,
  deleteById,
  updById,
  saveAdd,
  getById
} from "@/api/EmergencyDisposal/xyyp.js";
import { yanpan_table } from "./components/config";
import { getDictByGroup } from "@/api/common.js";
export default {
  name: "InformationList",
  components: {},
  data() {
    return {
      tables: yanpan_table, // 研判标准
      type: 0,
      multipleSelection: [],
      // 筛选信息
      formData: [
        {
          elType: "input",
          id: "responseLvName",
          label: "响应研判单",
          attrs: {
            value: "",
            size: "small",
            "collapse-tags": true
          }
        },
        {
          elType: "select",
          id: "eventCode",
          label: "事件类别",
          dic: "dic_xqlb",
          attrs: {
            value: "",
            size: "small",
            // clearable: true,
            filterable: true,
            "collapse-tags": true
          },
          options: []
        },
        {
          elType: "select",
          id: "responseLvCode",
          label: "响应级别",
          dic: "dic_yjjb",
          attrs: {
            value: "",
            // clearable: true,
            size: "small",
            filterable: true,
            "collapse-tags": true
          },
          options: []
        },
        {
          elType: "input",
          id: "effectRange",
          label: "影响范围",
          attrs: {
            value: "",
            size: "small",
            // clearable: true,
            filterable: true,
            "collapse-tags": true
          }
        },
        {
          elType: "dateTimePicker",
          id: "judgeTime",
          label: "研判时间",
          attrs: {
            value: "",
            size: "small",
            type: "datetime",
            "value-format": "yyyy-MM-dd HH:mm:ss"
          }
        },
        {
          elType: "select",
          id: "isResponse",
          label: "是否启动响应",
          // dic: "dic_xxly",
          attrs: {
            value: "",
            size: "small",
            // clearable: true,
            filterable: true,
            "collapse-tags": true
          },
          options: [
            {
              label: "否",
              value: "0"
            },
            {
              label: "是",
              value: "1"
            }
          ]
        },
        {
          elType: "select",
          id: "receiveTimes",
          label: "关联响应命令单",
          attrs: {
            value: "",
            size: "small",
            // clearable: true,
            filterable: true,
            "collapse-tags": true
          }
        },
        {
          elType: "select",
          id: "warningInfoStatus",
          label: "状态",
          attrs: {
            value: "",
            size: "small",
            // clearable: true,
            filterable: true,
            "collapse-tags": true
          },
          options: [
            {
              label: "编辑中",
              value: "0"
            },
            {
              label: "待审批",
              value: "1"
            },
            {
              label: "已审批",
              value: "2"
            }
          ]
        }
      ],
      // 表格信息
      table: {
        isSelectFlag: true, // 是否展示选择器
        compRef: "gjxm",
        isSequenceFlag: true, // 是否展示序号
        isShowPage: true, // 是否展示分页
        resetFlag: true,
        loading: false,
        title: "响应研判单列表",
        actions: [
          // {
          //   id: "dialogVisible",
          //   text: "新增",
          //   type: "primary",
          //   btnAttr: { size: "small" }
          // }
          // {
          //   id: "yjtzd",
          //   text: "预警通知单",
          //   type: "primary",
          //   btnAttr: { size: "small" }
          // }
        ],
        tableData: [],
        columns: [
          {
            prop: "judgeName",
            label: "响应研判单",
            align: "center",
            "min-width": "230px",
            render: (h, { row }) => {
              return (
                <div>
                  {
                    <span
                      style='color:#110e95;cursor:pointer;text-decoration: underline;'
                      {...{
                        on: {
                          click: () => {
                            this.detailList(row);
                          }
                        }
                      }}
                    >
                      {row.judgeName}
                    </span>
                  }
                </div>
              );
            }
          },
          {
            prop: "eventName",
            label: "事件类别",
            align: "center"
          },
          {
            prop: "responseLvName",
            label: "响应级别",
            align: "center"
          },
          {
            prop: "effectRange",
            label: "影响范围",
            align: "center"
          },
          {
            prop: "judgeTime",
            label: "研判时间",
            align: "center",
            "min-width": "120px"
            // render: (h, { row }) => {
            //   return (
            //     <div>
            //       {
            //         <span>
            //           {row.effectStartTime}至{row.effectEndTime}
            //         </span>
            //       }
            //     </div>
            //   )
            // }
          },
          {
            prop: "isResponse",
            label: "是否启动响应",
            align: "center"
          },
          {
            prop: "receiveTimes",
            label: "关联响应命令单",
            align: "center",
            "min-width": "200px",
            render: (h, { row }) => {
              return (
                <div>
                  {
                    <span
                      style='color:#110e95;cursor:pointer;text-decoration: underline;'
                      {...{
                        on: {
                          click: () => {
                            this.detailList(row);
                          }
                        }
                      }}
                    >
                      {row.receiveTimes}
                    </span>
                  }
                </div>
              );
            }
          },
          {
            prop: "judgeState",
            label: "状态",
            align: "center",
            "min-width": "100px",
            formatter: (row, column, cellValue, index) => {
              if (cellValue === "0") {
                return "待审批";
              } else if (cellValue === "1") {
                return "待审批";
              } else if (cellValue === "2") {
                return "已审批";
              }
            }
          },
          {
            prop: "cz",
            label: "操作",
            align: "center",
            fixed: "right",
            "min-width": "100px",
            render: (h, { row }) => {
              return (
                <div>
                  {
                    <span
                      style='color:#110e95;cursor:pointer;text-decoration: underline;margin:0 10px'
                      {...{
                        on: {
                          click: () => {
                            this.handleCheck(row);
                          }
                        }
                      }}
                    >
                      {row.judgeState === "0" ? "审批" : ""}
                    </span>
                  }
                </div>
              );
            }
          }
        ],
        // 表格样式
        tableAttr: {
          "max-height": "470px",
          height: "470px",
          stripe: false,
          border: true,
          fit: true,
          "show-header": true,
          "highlight-current-row": true,
          "cell-style": {
            "font-size": "16px"
          },
          "header-cell-style": {
            "text-align": "center",
            "background-color": "#B1C8F9",
            border: "1px solid #ccc",
            "font-size": "16px"
          }
        }
      },
      tableInformation: {
        isSelectFlag: false,
        compRef: "gjxm",
        isSequenceFlag: false,
        // isShowPage: true,
        resetFlag: true,
        loading: false,
        // title: "灾情信息报送单列表",
        actions: [
        ],
        tableData: [
          {
            createTime: "国网"
          },
          {
            createTime: "合计"
          }
        ],
        columns: [
          {
            prop: "createTime",
            label: "所属单位",
            align: "center",
            "min-width": "90px"
          },
          {
            prop: "",
            label: "输电线路",
            align: "center",
            "min-width": "80px",
            children: [
              {
                label: "110kV",
                align: "center",
                "min-width": "80px",
                children: [
                  {
                    prop: "sumPublicFields.oneKvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "90px"
                  },
                  {
                    prop: "sumPublicFields.oneKvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "90px"
                  }
                ]
              },
              {
                label: "35kV",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "sumPublicFields.threeKvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "90px"
                  },
                  {
                    prop: "sumPublicFields.threeKvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "90px"
                  }
                ]
              }
            ]
          },
          {
            label: "变电站",
            align: "center",
            "min-width": "100px",
            children: [
              {
                label: "110kV",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "sumPublicFields.oneKvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "90px"
                  },
                  {
                    prop: "sumPublicFields.oneKvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "90px"
                  }
                ]
              },
              {
                label: "35kV",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "sumPublicFields.threeKvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "90px"
                  },
                  {
                    prop: "sumPublicFields.threeKvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "90px"
                  }
                ]
              }
            ]
          },
          {
            label: "配电线路",
            align: "center",
            "min-width": "100px",
            children: [
              {
                label: "10kV",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "sumPublicFields.threeKvTrip",
                    label: "累计停运",
                    align: "center",
                    "min-width": "90px"
                  },
                  {
                    prop: "sumPublicFields.threeKvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "90px"
                  }
                ]
              }
            ]
          }
        ],
        tableAttr: {
          "max-height": "260px",
          height: "260px",
          stripe: false,
          border: true,
          fit: true,
          "show-header": true,
          "highlight-current-row": true,
          "cell-style": {
            "font-size": "16px"
          },
          "header-cell-style": {
            "text-align": "center",
            "background-color": "#B1C8F9",
            border: "1px solid #ccc",
            "font-size": "16px"
          }
        }
      },
      // 分页信息
      paginationAtrrs: {
        total: 0,
        layout: "total, sizes, prev, pager, next, jumper",
        "current-page": 1,
        "page-size": 10,
        "page-sizes": [10, 20, 30, 40, 50, 100]
      },
      activeNames: ["1", "2", "3", "4", "5", "6"], // 折叠面板默认展开列
      activeNames1: ["1", "2"], // 折叠面板默认展开列
      form: {}, // 筛选from
      pageNum: 1,
      pageSize: 10,
      // 弹窗信息
      dialogConfig: {
        title: "响应研判单",
        isShow: false, // 弹窗显示隐藏
        btnList: [
          {
            name: "同意",
            id: "BSubmit", // 事件名
            type: "primary",
            size: "small"
          },
          {
            name: "驳回",
            id: "submitForm",
            size: "small"
          },
          // {
          //   name: "驳回",
          //   id: "Qxiao",
          //   size: "small"
          // },
          {
            name: "取消",
            id: "Qxiao",
            size: "small"
          }
        ]
      },
      // 弹窗信息
      dialogConfig1: {
        title: "研判结果处理",
        isShow: false, // 弹窗显示隐藏
        btnList: [
          {
            name: "生成预警通知单",
            id: "BSubmit", // 事件名
            type: "primary",
            size: "small"
          },
          {
            name: "取消",
            id: "Qxiao",
            size: "small"
          }
        ]
      },
      // 折叠面板信息
      titleConfig: [
        {
          title: "事件信息",
          name: "1",
          slot: "slot1"
        },
        {
          title: "灾情信息",
          name: "2",
          slot: "slot2"
        },
        {
          title: "研判标准",
          name: "3",
          slot: "slot3"
        },

        {
          title: "研判结果",
          name: "4",
          slot: "slot4"
        },
        {
          title: "填报信息",
          name: "5",
          slot: "slot5"
        },
        {
          title: "审批信息",
          name: "6",
          slot: "slot6"
        }
      ],
      // 折叠面板信息
      titleConfig1: [
        {
          title: "研判结果",
          name: "1",
          slot: "slot1"
        },
        {
          title: "审批信息",
          name: "2",
          slot: "slot2"
        }
      ],
      // 弹窗表单信息
      formConfig: {
        formData: [
          {
            type: "select",
            label: "应急事件",
            prop: "infoSource",
            dic: "dic_xxly",
            class: "sjgy",
            lableWidth: "100px",
            option: []
          },
          {
            type: "input",
            label: "事件类别",
            prop: "infoSource3",
            isDisabled: true,
            class: "half",
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "事件级别",
            prop: "infoSource4",
            isDisabled: true,
            class: "half",
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "影响范围",
            prop: "infoSource5",
            isDisabled: true,
            class: "half",
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "发生时间",
            prop: "infoSource6",
            isDisabled: true,
            class: "half",
            lableWidth: "100px"
          },
          {
            type: "textarea",
            label: "事件概要",
            prop: "infoSource7",
            isDisabled: true,
            class: "sjgy",
            lableWidth: "100px"
          }
        ],
        rules: {
          infoSource: [
            { required: true, message: "请选择预警信息", trigger: "change" }
          ]
        }
      },
      // 弹窗表单信息  - 研判结果
      formConfig1: {
        formData: [
          {
            type: "input",
            label: "响应研判单",
            prop: "warningInfo",
            class: "half",
            lableWidth: "120px"
          },
          {
            type: "select",
            label: "是否启动响应",
            prop: "dangerCode",
            class: "half",
            lableWidth: "120px",
            option: [
              { label: "是", value: "1" },
              { label: "否", value: "0" }
            ]
          },
          {
            type: "input",
            label: "事件类别",
            prop: "warningInfo",
            class: "half",
            lableWidth: "120px"
          },
          {
            type: "select",
            label: "响应级别",
            prop: "warningLvCode",
            dic: "dic_yjjb",
            class: "half",
            lableWidth: "120px",
            option: []
          },
          {
            type: "input",
            label: "影响范围",
            prop: "effectRange",
            class: "half",
            lableWidth: "120px"
          },
          {
            type: "dataPicker",
            label: "影响时间",
            prop: "effectStartTime",
            class: "half",
            dateType: "datetimerange",
            lableWidth: "120px"
          },
          {
            type: "textarea",
            label: "措施建议",
            prop: "incidentOutline",
            class: "sjgy",
            lableWidth: "120px"
          },
          {
            type: "select",
            label: "研判人",
            prop: "warningLvCode",
            dic: "dic_yjjb",
            class: "sjgy",
            lableWidth: "120px",
            option: []
          },
          {
            type: "dataPicker",
            label: "研判时间",
            prop: "effectStartTime",
            class: "half",
            dateType: "datetime",
            lableWidth: "120px"
          }
        ],
        rules: {
          warningInfo: [
            {
              required: true,
              message: "请输入预警信息名称",
              trigger: "change"
            }
          ],
          warningLvCode: [
            { required: true, message: "请选择预警级别", trigger: "change" }
          ],
          effectRange: [
            { required: true, message: "请选择影响范围", trigger: "change" }
          ],
          incidentOutline: [
            { required: true, message: "请输入事件概要", trigger: "change" }
          ],
          effectStartTime: [
            { required: true, message: "请选择影响时间", trigger: "change" }
          ],
          dangerCode: [
            { required: true, message: "请选择险情类别", trigger: "change" }
          ]
        }
      },
      // 弹窗表单信息
      formConfig2: {
        disabled: true,
        formData: [
          {
            type: "input",
            label: "填报人",
            prop: "creator",
            class: "third",
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "单位及部门",
            class: "third",
            prop: "createDeptName",
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "填报时间",
            class: "third",
            prop: "createTime",
            lableWidth: "100px"
          }
        ]
      },
      // 弹窗表单信息
      formConfig3: {
        formData: [
          {
            type: "input",
            label: "审批意见",
            prop: "emergencyEvent",
            class: "sjgy",
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "审批人",
            isDisabled: true,
            prop: "creator",
            class: "third",
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "单位及部门",
            isDisabled: true,
            class: "third",
            prop: "createDeptName",
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "审批时间",
            isDisabled: true,
            class: "third",
            prop: "createTime",
            lableWidth: "100px"
          }
        ]
      },
      // 弹窗表单信息
      formConfig4: {
        disabled: true,
        formData: [
          {
            type: "input",
            label: "预警研判单",
            prop: "warningInfo",
            class: "half",
            lableWidth: "120px"
          },
          {
            type: "input",
            label: "是否启动预警",
            prop: "dangerCode",
            class: "half",
            lableWidth: "120px"
          },
          {
            type: "input",
            label: "险情类别",
            prop: "warningInfo",
            class: "half",
            lableWidth: "120px"
          },
          {
            type: "input",
            label: "预警级别",
            prop: "warningLvCode",
            class: "half",
            lableWidth: "120px"
          },
          {
            type: "input",
            label: "影响范围",
            prop: "effectRange",
            class: "half",
            lableWidth: "120px"
          },
          {
            type: "input",
            label: "影响时间",
            prop: "effectStartTime",
            class: "half",
            lableWidth: "120px"
          },
          {
            type: "textarea",
            label: "措施建议",
            prop: "incidentOutline",
            class: "sjgy",
            lableWidth: "120px"
          },
          {
            type: "textarea",
            label: "研判人",
            prop: "warningLvCode",
            class: "sjgy",
            lableWidth: "120px"
          },
          {
            type: "input",
            label: "研判时间",
            prop: "effectStartTime",
            class: "half",
            lableWidth: "120px"
          }
        ]
      },
      // 弹窗表单信息
      formConfig5: {
        disabled: true,
        formData: [
          {
            type: "input",
            label: "审批意见",
            prop: "emergencyEvent",
            class: "sjgy",
            lableWidth: "120px"
          },
          {
            type: "input",
            label: "审批人",
            isDisabled: true,
            prop: "creator",
            class: "third",
            lableWidth: "120px"
          },
          {
            type: "input",
            label: "单位及部门",
            isDisabled: true,
            class: "third",
            prop: "createDeptName",
            lableWidth: "120px"
          },
          {
            type: "input",
            label: "审批时间",
            isDisabled: true,
            class: "third",
            prop: "createTime",
            lableWidth: "120px"
          }
        ]
      }
    };
  },
  watch: {
    $route: {
      handler() {
        this.list();
      },
      deep: true
    }
  },
  mounted() {
    this.list();
    this.getInputVal();
  },
  methods: {
    yjtzd() {
      this.dialogConfig1.isShow = true;
    },
    // 弹窗按钮点击事件 对应id绑定事件
    handleBtn(item) {
      this[item.id]();
    },
    handleBtn1(item) {
      this[item.id]();
    },
    // 重置
    reset() {
      this.form = this.$options.data().form;
      this.list();
    },
    // 检索
    async query() {
      const parmas = {
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        warningInfo: this.form.warningInfo,
        dangerCode: this.form.dangerCode,
        warningLvCode: this.form.warningLvCode,
        effectRange: this.form.effectRange,
        effectStartTime: this.form.effectStartTime,
        infoSource: this.form.infoSource,
        receiveTimes: this.form.receiveTimes
      };
      const res = await listPage(parmas);
      this.table.tableData = res.data;
      this.paginationAtrrs.total = res.total;
    },
    // 驳回
    async submitForm() {
      this.$refs.formComponent.isValidate();
      this.$refs.formComponent1.isValidate();
      const flag = this.$refs.formComponent.flag;
      const flag1 = this.$refs.formComponent1.flag;
      if (flag && flag1) {
        const parmas = {
          dangerCode: this.$refs.formComponent1.form.dangerCode,
          dangerName: this.$refs.formComponent1.form.dangerCode,
          documentId: "",
          effectEndTime: this.$refs.formComponent1.form.effectStartTime[1],
          effectRange: this.$refs.formComponent1.form.effectRange,
          effectStartTime: this.$refs.formComponent1.form.effectStartTime[0],
          flowName: "预警信息新增",
          flowTime: "",
          incidentOutline: this.$refs.formComponent1.form.incidentOutline,
          infoSource: this.$refs.formComponent.form.infoSource,
          warningInfo: this.$refs.formComponent1.form.warningInfo,
          warningLvName: this.$refs.formComponent1.form.warningLvCode,
          warningLvCode: this.$refs.formComponent1.form.warningLvCode
        };
        if (this.type === 1) {
          const res = await saveAdd(parmas);
          if (res) {
            this.$message({
              message: "保存成功",
              type: "success"
            });
            this.list();
            this.dialogConfig.isShow = false;
          }
        } else {
          parmas.id = this.$refs.formComponent1.form.id;
          const res = await updById(parmas);
          if (res) {
            this.$message({
              message: "修改成功",
              type: "success"
            });
            this.list();
            this.dialogConfig.isShow = false;
          }
        }
      }

    },
    // 报送
    async BSubmit() {
      this.$refs.formComponent.isValidate();
      this.$refs.formComponent1.isValidate();
      const flag = this.$refs.formComponent.flag;
      const flag1 = this.$refs.formComponent1.flag;
      if (flag && flag1) {
        const parmas = {
          creator: "朱",
          modifier: "朱",
          createDeptName: "营销部",
          effectRange: this.$refs.formComponent1.form.effectRange,
          emergencyEvent: this.$refs.formComponent1.form.emergencyEvent,
          eventLvCode: this.$refs.formComponent1.form.eventLvCode,
          eventCode: this.$refs.formComponent1.form.eventCode,
          incidentOutline: this.$refs.formComponent1.form.incidentOutline,
          infoSourceCode: this.$refs.formComponent.form.infoSourceCode,
          occurrenceTime: this.$refs.formComponent1.form.occurrenceTime,
          noticeId: this.$refs.formComponent.form.noticeId
        };
        const res = await EmergencyEventgetSubmit(parmas);
        if (res) {
          this.$message({
            message: "报送成功",
            type: "success"
          });
          this.dialogConfig.isShow = false;
          this.list();
        }
      }
    },
    // 取消
    Qxiao() {
      this.$refs.formComponent.form = this.$refs.formComponent.$options.data().form;
      this.$refs.formComponent1.form = this.$refs.formComponent1.$options.data().form;
      this.$refs.formComponent2.form = this.$refs.formComponent2.$options.data().form;
      this.$nextTick(() => {
        this.$refs.formComponent.$refs.formInlines.clearValidate();
        this.$refs.formComponent1.$refs.formInlines.clearValidate();
        this.$refs.formComponent2.$refs.formInlines.clearValidate();
      });
      this.dialogConfig.isShow = false;
      this.dialogConfig1.isShow = false;
    },
    // 弹窗关闭图标
    close() {
      this.$refs.formComponent.form = this.$refs.formComponent.$options.data().form;
      this.$refs.formComponent1.form = this.$refs.formComponent1.$options.data().form;
      this.$refs.formComponent2.form = this.$refs.formComponent2.$options.data().form;
      this.$nextTick(() => {
        this.$refs.formComponent.$refs.formInlines.clearValidate();
        this.$refs.formComponent1.$refs.formInlines.clearValidate();
        this.$refs.formComponent2.$refs.formInlines.clearValidate();

      });
      this.dialogConfig.isShow = false;
      this.dialogConfig1.isShow = false;
    },
    // 获取下拉框数据
    getInputVal() {
      this.formData.forEach((item) => {
        if (item.dic) {
          getDictByGroup({ groupCode: item.dic }).then(res => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: Number(item.dicCode)
              };
            });
            item.options = option;
          });
        }
      });
      this.formConfig.formData.forEach((item) => {
        if (item.dic) {
          getDictByGroup({ groupCode: item.dic }).then(res => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: Number(item.dicCode)
              };
            });
            item.option = option;
          });
        }
      });
      this.formConfig1.formData.forEach((item) => {
        if (item.dic) {
          getDictByGroup({ groupCode: item.dic }).then(res => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: Number(item.dicCode)
              };
            });
            item.option = option;
          });
        }
      });
    },
    // 列表
    async list() {
      const parmas = {
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        judgeState: 0
        // warningInfoStatus: this.warningInfoStatusId
      };
      const res = await listPage(parmas);
      this.table.tableData = res.data;
      this.paginationAtrrs.total = res.total;
    },
    // 抛出列表按钮
    onActionClick(item, index) {
      this[item.id](); // 调用按钮对应方法
    },
    // 新增
    dialogVisible() {
      this.dialogConfig.isShow = true;
      this.type = 1;
      // this.$refs.formComponent2.form.creator = "555"
    },
    // 详情
    detailList(id) {
      this.$router.push({
        name: "InformationDetail",
        query: { id: id.id }
      });
    },
    // 选择器
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    // 审批
    handleCheck(id) {
      this.dialogConfig.isShow = true;
      getById({ id: id.id }).then(res => {
        this.type = 0;
        this.$refs.formComponent.form = res;
        this.$refs.formComponent1.form = res;
        this.$refs.formComponent2.form = res;
      });
    },
    // 删除
    async detailForm(id) {
      const res = await deleteById({
        id: id.id
      });
      if (res) {
        this.$message({
          message: "删除成功",
          type: "success"
        });
        this.list();
      }

    },
    // 分页
    handleSizeChange(val) {
      this.pageNum = val["current-page"];
      this.pageSize = val["page-size"];
      this.list();
    }
  }
};
</script>

<style scoped lang="less">
@import "../../../assets/style/ComponentStyle.less";

:deep(.el-breadcrumb__inner.is-link) {
  font-weight: 100;
  color: #fff;
}

.EmergencyList :deep(.el-breadcrumb__item:last-child .el-breadcrumb__inner) {
  color: #3270ff;
}

.box {
  // width: 100%;
  // height: 80vh;
  // padding: 0;
  // margin: 0;
  margin-top: 20px;
  background-color: #fff;
  border-radius: 4px;
  padding: 10px;
  box-sizing: border-box;
}
</style>
